<div class="widget-content">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'home-form',
	'enableAjaxValidation'=>false,
	'htmlOptions'=>array('class'=>'form-horizontal', 'novalidate'=>'novalidate'),
)); ?>

	<?php if($form->errorSummary($model)):?>
			<div class="alert alert-block">
				<a class="close" data-dismiss="alert" href="#">&times;</a>
				<h4 class="alert-heading"><?php echo $form->errorSummary($model); ?></h4>
			</div>
	<?php endif;?>
	<fieldset>
	<div class="control-group">
		<?php echo $form->labelEx($model,'title',array('class'=>'control-label','for'=>'title')); ?>
		<div class="controls">
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>300,'class'=>'input-large')); ?>
		<?php echo $form->error($model,'title'); ?>
		</div>
	</div>

	<div class="control-group">
		<?php echo $form->labelEx($model,'image',array('class'=>'control-label','for'=>'image')); ?>
		<div class="controls">
			<?php $this->widget('ext.kcfinder.EImageFinder',array('model'=>$model,'fieldName'=>'image','type'=>'images'));?>
			<?php echo $form->error($model,'image'); ?>
			<div id="ckeditor">
			</div>
			<?php if($model->image){
					echo '<div><img src="'.$model->image.'" style="max-width:150px"/></div>';
				}
			?>
		</div>
	</div>
	<div class="control-group">
		<?php echo $form->labelEx($model,'type',array('class'=>'control-label','for'=>'type')); ?>
		<div class="controls">
		<?php echo $form->dropDownList($model,'type', $type); ?>
		<?php echo $form->error($model,'type'); ?>
		</div>
	</div>
	<div class="control-group">
		<?php echo $form->labelEx($model,'link',array('class'=>'control-label','for'=>'link')); ?>
		<div class="controls">
		<?php echo $form->textField($model,'link',array('size'=>60,'maxlength'=>300,'class'=>'input-large')); ?>
		<?php echo $form->error($model,'link'); ?>
		</div>
	</div>
	<div class="control-group">
		<?php echo $form->labelEx($model,'hot',array('class'=>'control-label','for'=>'hot')); ?>
		<div class="controls">
			<div class="btn-group" data-toggle="buttons-radio">
				<a onclick="document.getElementById('Home_hot').value=1;" class="btn btn-primary <?php if($model->hot=='1'){echo 'active';}?>">Hot</a>
				<a onclick="document.getElementById('Home_hot').value=0;" class="btn btn-primary <?php if($model->hot=='0'){echo 'active';}?>">Free</a>
			</div>
			<?php echo $form->hiddenField($model,'hot'); ?>
			<?php echo $form->error($model,'hot'); ?>
		</div>
	</div>
	<?php echo $form->hiddenField($model,'order');?>
	<div class="control-group">
		<?php echo $form->labelEx($model,'active',array('class'=>'control-label','for'=>'active')); ?>
		<div class="controls">
			<div class="btn-group" data-toggle="buttons-radio">
				<a onclick="document.getElementById('Home_active').value=1;" class="btn btn-primary <?php if($model->active=='1'){echo 'active';}?>">True</a>
				<a onclick="document.getElementById('Home_active').value=0;" class="btn btn-primary <?php if($model->active=='0'){echo 'active';}?>">False</a>
			</div>
			<?php echo $form->hiddenField($model,'active'); ?>
			<?php echo $form->error($model,'active'); ?>
		</div>
	</div>
	<div class="form-actions">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array('class'=>'btn btn-primary btn-large')); ?>
		<?php echo CHtml::link('Cancel',array('/home/admin'),array('class'=>'btn btn-large')); ?>
	</div>
	</fieldset>
<?php $this->endWidget(); ?>
</div><!-- form -->